﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Collections;

namespace LED_Editor.Controls
{
    public class TracksDataGridView2 : DataGridView
    {
        public TracksDataGridView2()
        {
            this.Rows.CollectionChanged += new System.ComponentModel.CollectionChangeEventHandler(Rows_CollectionChanged);
            this.RowStateChanged += new DataGridViewRowStateChangedEventHandler(TracksDataGridView2_RowStateChanged);
        }

        void TracksDataGridView2_RowStateChanged(object sender, DataGridViewRowStateChangedEventArgs e)
        {
            Console.WriteLine(e.StateChanged);
        }

        void Rows_CollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e)
        {
            Console.WriteLine(e.Action);
            //Sort(DummyComparer.Instance);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
        }
     

        protected override void OnRowStateChanged(int rowIndex, DataGridViewRowStateChangedEventArgs e)
        {
            base.OnRowStateChanged(rowIndex, e);
        }
    }

    public class DummyComparer : IComparer
    {

        #region IComparer Members

        public int Compare(object x, object y)
        {
            return 0;
        }

        #endregion
        private static DummyComparer _instance;
        public static DummyComparer Instance
        {
            get
            { 
                if (_instance==null)
                    _instance = new DummyComparer();
                return _instance;
            }
        }

    }
}
